<template>
	<view>
		<u-icon name="photo" color="#2979ff" size="28" @click="loginAc"></u-icon>
	</view>
</template>

<script>
	import {mapActions} from 'vuex'
	export default {
		data() {
			return {
				
			}
		},
		onLoad() {
			
				uni.authorize({
				    scope: 'scope.userInfo',
				    success() {
				      uni.getUserProfile({complete:res=>{
				      	console.log(res)
				      }})
				    }
				})
				uni.openSetting({
				  complete(res) {
				    console.log(res)
				  }
				});
		
		},
		methods: {
			...mapActions('m_login',['loginAction']),
			//moduleLogin
			loginAc(){
				uni.login({complete:res=>{
					console.log(res)
					this.loginAction({data:{code:res.code}})
				
					
				}}) 
			}
			
			
		}
	}
</script>

<style>

</style>
